package com.microlecture.entity;

public class CookbookFood {
    private Integer id;

    private Integer cookbookid;

    private Integer foodid;

    private Integer weight;

    private Food food;

    public Food getFood() {
        return food;
    }

    public void setFood(Food food) {
        this.food = food;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCookbookid() {
        return cookbookid;
    }

    public void setCookbookid(Integer cookbookid) {
        this.cookbookid = cookbookid;
    }

    public Integer getFoodid() {
        return foodid;
    }

    public void setFoodid(Integer foodid) {
        this.foodid = foodid;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", cookbookid=").append(cookbookid);
        sb.append(", foodid=").append(foodid);
        sb.append(", weight=").append(weight);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CookbookFood other = (CookbookFood) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCookbookid() == null ? other.getCookbookid() == null : this.getCookbookid().equals(other.getCookbookid()))
            && (this.getFoodid() == null ? other.getFoodid() == null : this.getFoodid().equals(other.getFoodid()))
            && (this.getWeight() == null ? other.getWeight() == null : this.getWeight().equals(other.getWeight()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCookbookid() == null) ? 0 : getCookbookid().hashCode());
        result = prime * result + ((getFoodid() == null) ? 0 : getFoodid().hashCode());
        result = prime * result + ((getWeight() == null) ? 0 : getWeight().hashCode());
        return result;
    }
}